<?php global $user; ?>
<ul class="nav navbar-nav navbar-right">
  <?php if($user->uid): ?>
    <li><button type="button" class="btn navbar-btn btn-post-link btn-submit-style-1" data-toggle="modal" data-target="#modalPostLink">Post link</button></li>
    <li class="dropdown">
      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php print _nav_user_picture_name() ?> <span class="caret"></span></a>
      <ul class="dropdown-menu" role="menu">
        <?php if(module_exists('cpanel')): ?>
          <li><?php print l(CommonHelper::crabii_icon('user') . '&nbsp;&nbsp;' . t('Your profiles'), "user/{$user->uid}/edit", array('html' => TRUE)) ?></li>
          <li><?php print l(CommonHelper::crabii_icon('tags') . '&nbsp;&nbsp;' . t('Manage boards'), 'cpanel/board-management', array(
              'html' => TRUE,
              'query' => array('destination' => 'cpanel/board-management')
            ))
            ?></li>
          <li><?php print l(CommonHelper::crabii_icon('paperclip') . '&nbsp;&nbsp;' . t('Manage links'), 'cpanel/link-management', array(
              'html' => TRUE,
              'query' => array('destination' => 'cpanel/link-management')
            )) ?></li>
        <?php endif; ?>
        <li class="divider"></li>
        <li><?php print l(CommonHelper::crabii_icon('sign-out') . '&nbsp;&nbsp;' . t('Log out'), 'user/logout', array('html' => TRUE)); ?></li>
      </ul>
    </li>
  <?php else: ?>
    <li><?php print l(t('Register an account'), 'user/register'); ?>
    <li><button type="button" class="btn btn-primary navbar-btn btn-login" data-toggle="modal" data-target="#modalLogin">Login</button></li>
  <?php endif; ?>
</ul>
